package pub.elephants.net.client;

import pub.elephants.net.body.ElephantsRequest;
import pub.elephants.net.body.ElephantsResponse;
import pub.elephants.serializable.ElephantsSerializable;

/**
 *client
 */
public abstract class ElephantsClient {

    protected String serverAddress;
    protected ElephantsSerializable serializer;
    protected long timeoutMillis;

    /**
     *
     * @param serverAddress
     * @param serializer
     * @param timeoutMillis
     */
    public void init(String serverAddress, ElephantsSerializable serializer, long timeoutMillis) {
        this.serverAddress = serverAddress;
        this.serializer = serializer;
        this.timeoutMillis = timeoutMillis;
    }

    /**
     *
     * @param request
     * @return
     * @throws Exception
     */
    public abstract ElephantsResponse send(ElephantsRequest request) throws Exception;

}
